package com.qiangxi.checkupdatelibrary.callback;
/*
 * Copyright © qiangxi(任强强)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.io.File;

/**
 * Created by qiangxi(任强强) on 2017/9/25.<p>
 * Download回调 所有回调接口全部被分发到了主线程，可以放心使用
 * </p>
 */
public interface DownloadCallback extends BaseCallback {
    /**
     * 下载进度的回调，每隔1s回调一次
     *
     * @param currentLength 当前下载的字节数
     * @param totalLength   apk的总字节数
     */
    void downloadProgress(long currentLength, long totalLength);

    /**
     * 下载成功的回调
     *
     * @param apk 下载的apk文件，可在此回调中调用安装apk方法进行安装
     */
    void downloadSuccess(File apk);

}
